home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qfiledefs.h.z / qfiledefs.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  3.7 KB  |  167 lines

  1. /****************************************************************************
  2. ** $Id: qfiledefs.h,v 2.9 1998/07/03 00:09:44 hanord Exp $
  3. **
  4. **              ***   INTERNAL HEADER FILE   ***
  5. **
  6. **        This file is NOT a part of the Qt interface!
  7. **
  8. ** Common macros and system include files for QFile, QFileInfo and QDir.
  9. ** This file is included by qfile.cpp, qfileinfo.cpp and qdir.cpp
  10. **
  11. ** Created : 930812
  12. **
  13. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  14. **
  15. ** This file is part of Qt Free Edition, version 1.40.
  16. **
  17. ** See the file LICENSE included in the distribution for the usage
  18. ** and distribution terms, or http://www.troll.no/free-license.html.
  19. **
  20. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  21. ** your own programs or libraries.
  22. **
  23. ** Please see http://www.troll.no/pricing.html for information about 
  24. ** Qt Professional Edition, which is this same library but with a
  25. ** license which allows creation of commercial/proprietary software.
  26. **
  27. *****************************************************************************/
  28.  
  29. #if !defined(_OS_MAC_)
  30. # include <sys/types.h>
  31. # include <sys/stat.h>
  32. #endif
  33. #include <fcntl.h>
  34. #include <errno.h>
  35. #if defined(UNIX)
  36. # include <dirent.h>
  37. # include <unistd.h>
  38. #endif
  39. #if defined(_OS_MSDOS_) || defined(_OS_WIN32_) || defined(_OS_OS2_)
  40. # define _OS_FATFS_
  41. # if defined(__CYGWIN32__)
  42. #  include <dirent.h>
  43. #  include <unistd.h>
  44. # else
  45. #  include <io.h>
  46. #  include <dos.h>
  47. #  include <direct.h>
  48. # endif
  49. #endif
  50. #include <limits.h>
  51.  
  52.  
  53. #if !defined(PATH_MAX)
  54. #if defined( MAXPATHLEN )
  55. #define PATH_MAX MAXPATHLEN
  56. #else
  57. #define PATH_MAX 1024
  58. #endif
  59. #endif
  60.  
  61.  
  62. #undef STATBUF
  63. #undef STAT
  64. #undef STAT_REG
  65. #undef STAT_DIR
  66. #undef STAT_LNK
  67. #undef STAT_MASK
  68. #undef FILENO
  69. #undef OPEN
  70. #undef CLOSE
  71. #undef LSEEK
  72. #undef READ
  73. #undef WRITE
  74. #undef ACCESS
  75. #undef GETCWD
  76. #undef CHDIR
  77. #undef MKDIR
  78. #undef RMDIR
  79. #undef OPEN_RDONLY
  80. #undef OPEN_WRONLY
  81. #undef OPEN_CREAT
  82. #undef OPEN_TRUNC
  83. #undef OPEN_APPEND
  84. #undef OPEN_TEXT
  85. #undef OPEN_BINARY
  86.  
  87.  
  88. #if defined(_CC_MSVC_) || defined(_CC_SYM_)
  89.  
  90. # define STATBUF    struct _stat        // non-ANSI defs
  91. # define STAT        ::_stat
  92. # define FSTAT        ::_fstat
  93. # define STAT_REG    _S_IFREG
  94. # define STAT_DIR    _S_IFDIR
  95. # define STAT_MASK    _S_IFMT
  96. # if defined(_S_IFLNK)
  97. #  define STAT_LNK    _S_IFLNK
  98. # endif
  99. # define FILENO        _fileno
  100. # define OPEN        ::_open
  101. # define CLOSE        ::_close
  102. # define LSEEK        ::_lseek
  103. # define READ        ::_read
  104. # define WRITE        ::_write
  105. # define ACCESS        ::_access
  106. # define GETCWD        ::_getcwd
  107. # define CHDIR        ::_chdir
  108. # define MKDIR        ::_mkdir
  109. # define RMDIR        ::_rmdir
  110. # define OPEN_RDONLY    _O_RDONLY
  111. # define OPEN_WRONLY    _O_WRONLY
  112. # define OPEN_RDWR    _O_RDWR
  113. # define OPEN_CREAT    _O_CREAT
  114. # define OPEN_TRUNC    _O_TRUNC
  115. # define OPEN_APPEND    _O_APPEND
  116. # if defined(O_TEXT)
  117. #  define OPEN_TEXT    _O_TEXT
  118. #  define OPEN_BINARY    _O_BINARY
  119. # endif
  120.  
  121. #else                        // all other systems
  122.  
  123. # define STATBUF    struct stat
  124. # define STAT        ::stat
  125. # define FSTAT        ::fstat
  126. # define STAT_REG    S_IFREG
  127. # define STAT_DIR    S_IFDIR
  128. # define STAT_MASK    S_IFMT
  129. # if defined(S_IFLNK)
  130. #  define STAT_LNK    S_IFLNK
  131. # endif
  132. # define FILENO        fileno
  133. # define OPEN        ::open
  134. # define CLOSE        ::close
  135. # define LSEEK        ::lseek
  136. # define READ        ::read
  137. # define WRITE        ::write
  138. # define ACCESS        ::access
  139. # if defined(_OS_OS2EMX_)
  140. #  define GETCWD    ::_getcwd2
  141. #  define CHDIR        ::_chdir2
  142. # else
  143. #  define GETCWD    ::getcwd
  144. #  define CHDIR        ::chdir
  145. # endif
  146. # define MKDIR        ::mkdir
  147. # define RMDIR        ::rmdir
  148. # define OPEN_RDONLY    O_RDONLY
  149. # define OPEN_WRONLY    O_WRONLY
  150. # define OPEN_RDWR    O_RDWR
  151. # define OPEN_CREAT    O_CREAT
  152. # define OPEN_TRUNC    O_TRUNC
  153. # define OPEN_APPEND    O_APPEND
  154. # if defined(O_TEXT)
  155. #  define OPEN_TEXT    O_TEXT
  156. #  define OPEN_BINARY    O_BINARY
  157. # endif
  158. #endif
  159.  
  160.  
  161. #if defined(_OS_FATFS_)
  162. # define F_OK    0
  163. # define X_OK    1
  164. # define W_OK    2
  165. # define R_OK    4
  166. #endif
  167.